package cn.monkey.controller;

import cn.monkey.pojo.Role;
import cn.monkey.service.RoleService;
import cn.monkey.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RoleController {
    @Autowired
    RoleService roleService;

    @PostMapping("/system/roleManagement/insert")
    public ResultVo roleInsert(@RequestBody Role role){
        return roleService.save(role) ? ResultVo.success("新增角色成功",null) : ResultVo.error("新增角色失败");
    }
}
